home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
pctj0487.arc
/
CE_CONIO.ASM
< prev
next >
Wrap
Assembly Source File
|
1987-02-02
|
2KB
|
54 lines
;=====================================================================
; General-purpose console I/O routines
; For Break Handler (BRK_TEST) & Critical Error Handler (CE_TEST)
;=====================================================================
;---------------------------------------------------------------------
; GET_KEY
; Clears the keyboard buffer, waits for a key and returns it in AL.
; Returns -(key) for extended ASCII keystrokes
;---------------------------------------------------------------------
get_key proc near
mov ah,0cH ;clear kb buffer
mov al,07H ;console input function
int 21H
cmp al,0 ;extended ASCII?
jne gk_exit
mov ah,07H ;get the extended ASCII code
int 21H
neg al
gk_exit: ret
get_key endp
;---------------------------------------------------------------------
; DISP_MSG
; This function displays an ASCIIZ message at the current cursor pos
; DS:DX = address of start of the string
; Uses BIOS services only.
;---------------------------------------------------------------------
disp_msg proc near
mov si,dx
dm_10: lodsb
cmp al,0 ;done with the string?
je dm_20 ; yes, exit
mov bh,0 ; no, select video page 0
mov ah,0eH ; use write_tty service
int 10H ; to display a character
jmp dm_10 ; loop back for next character
dm_20:
ret
disp_msg endp
;---------------------------------------------------------------------
; BEEP
; sounds the bell by printing an ASCII 07H via BIOS write_tty service
;---------------------------------------------------------------------
beep proc near
mov al,07H
mov ah,0eH ;BIOS write_tty service
int 10H
ret
beep endp